package org.maxkey.portal.api.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport {


    @Bean
    public InterceptorSupport getInterceptorSupport(){
        return new InterceptorSupport();
    }

    /**
     * interceptor配置
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(getInterceptorSupport())
                .addPathPatterns("/**");
        super.addInterceptors(registry);//最后将register往这里塞进去就可以了
    }
}